/*
 * @(#)Content.java 2011
 *
 * Copyright 2011 classic-commerce
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 * @author: <a href="mailto:richard@ioniq.ca">Richard Mutezintare</a>
 *
 */

package ca.ioniq.client.widget.content;

import ca.ioniq.client.ClassicMessages;
import ca.ioniq.client.widget.ErrorMessageWidget;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;


public class NewsletterWidget extends FlowPanel {
    private static String ID = "newsletter";
    private ErrorMessageWidget errorMessageWidget;

    private Label subscribeLabel;
    private TextBox emailTextBox;
    private Button subscribeButton;

    private Image facebookLink;
    private Image youtubeLink;

    public NewsletterWidget(ErrorMessageWidget errors, ClassicMessages messages) {
        this.errorMessageWidget = errors;

        subscribeLabel = new Label(messages.subscribeLabel());
        emailTextBox = new TextBox();
        emailTextBox.setText(messages.emailTextBox());

        Image facebook = new Image("images/facebook.jpg");
        Image youtube = new Image("images/youtube.jpg");

        getElement().setId(ID);
    }

    public TextBox getEmailTextBox() {
        return emailTextBox;
    }

    public Button getSubscribeButton() {
        return subscribeButton;
    }

    public Image getFacebookLink() {
        return facebookLink;
    }

    public Image getYoutubeLink() {
        return youtubeLink;
    }

    public ErrorMessageWidget getErrorMessageWidget() {
        return errorMessageWidget;
    }
}
